Fractal approach for probabilistic flow cache maintenance

ABSTRACT

An apparatus sets a layer counter to point to a first layer of a data structure. The apparatus determines the layer counter to reference an overflowing cell. The apparatus increments the layer counter to point to a second layer of the data structure. The apparatus determines the incremented layer counter to reference a non-overflowing cell. The apparatus increments a value of the non-overflowing cell, wherein the first layer is stored in a first cache and the second layer is stored in a second cache, and wherein the first cache differs from the second cache with respect to one or more of speed or size.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of U.S. Provisional Application No.61/917,551 filed Dec. 18, 2013, which is incorporated herein byreference in its entirety.

TECHNICAL FIELD

This disclosure relates to the field of sets, and in particular, tofilters employable in set membership queries.

BACKGROUND

Filters may be employed with respect to sets. Insertion into a filtercan be performed with respect to in-set entities. If it is subsequentlydesired to know whether or not an entity is a member of the set, alookup can be performed with respect to the filter.

Certain filters allow for removal to be performed with respect toentities which cease to be in-set. However, filters which offer suchability tend demand that onerous sacrifices be made in return for thisremoval ability.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings.

FIG. 1 illustrates an example data structure in which examples of thepresent invention may operate.

FIG. 2 is a flow diagram illustrating a method of incrementing the countof an item, according to an example.

FIGS. 3A-3D illustrate the performance of incrementing the count of anitem, according to an example.

FIG. 4 is a flow diagram illustrating a method of decrementing the countof an item, according to an example.

FIGS. 5A and 5B illustrate the performance of decrementing the count ofan item, according to an example.

FIGS. 6A and 6B illustrate the performance of decrementing the count ofan item, according to another example.

FIGS. 7A-7E illustrate the performance of maintaining, with respect toeach of multiple items, count of that item, according to an example.

FIG. 8 is a flow diagram illustrating a method of lookup, according toan example.

FIG. 9 is a diagrammatic representation of a machine, according to anexample.

DETAILED DESCRIPTION

Filters may be employed with respect to sets. For instance, filters areemployable with respect to firewalls where it may be desired to knowwhether or not an incoming flow has been seen before and/or whether itmatches a set of filtering rules. In-set entities can be inserted intothe filter, and later set membership queries can be performed.

The ability to perform removal with respect to a filter is oftendesirable. For instance, removal might be performed with respect to anentity which had been in a set but then is removed from the set.Returning to the example of firewalls, removal might be desirable withrespect to expired flows.

However, filters that allow for such removal tend to require thatcertain sacrifices be made, such as that large, slow, and/or expensivememory be provided for the filter's use.

Set forth herein are examples of approaches by which a filter canprovide desirable features—including but not limited to allowing forremoval operations to be performed—while requesting meager resources inreturn.

The following description sets forth numerous specific details such asexamples of specific systems, components, methods, and so forth, inorder to provide a good understanding of several embodiments of thepresent invention. It will be apparent to one skilled in the art,however, that at least some embodiments of the present invention may bepracticed without these specific details. In other instances, well-knowncomponents or methods are not described in detail or are presented insimple block diagram format in order to avoid unnecessarily obscuringthe present invention. Thus, the specific details set forth are merelyexamples. Particular implementations may vary from these example-onlydetails and still be contemplated to be within the scope of the presentinvention.

Shown in FIG. 1 is an example data structure employable in connectionwith example functionality discussed herein. The data structure is madeup of cells arranged into m columns 101 and L layers 103. To facilitatediscussion, for the example of FIG. 1 the data structure is shown withm=8 and therefore eight columns of cells, and with L=3 and thereforethree layers of cells. To further facilitate discussion, the value of Lwill be considered to increase as one progresses from the top of thedata structure to the bottom of the data structure. As such, the toplayer of the data structure of FIG. 1 corresponds to L=1, the middlelayer of the data structure of FIG. 1 corresponds to L=2, and the bottomlayer of the data structure of FIG. 1 corresponds to L=3. An alternatenumbering scheme might be employed (e.g., the value of L might decreaseas one progresses from the top of the data structure to the bottom ofthe data structure).

According to an example, each cell holds a certain quantity of bits(e.g., mappable to an integer). Each of the cells of a given row mayeach possess the same number of bits. Moreover, the quantity of bitsemployed per cell may increase as one progresses from upper layers ofthe data structure to lower layers of the data structure. As such,bearing in mind the discussed L numbering scheme of the example of FIG.1, the quantity of bits employed per cell may increase as one progressesfrom layer L=1 to layer L=3. Such increase in the number of bits percell may proceed in a stepwise fashion. For instance, the number of bitsemployed for the cells of a row may double as one proceeds to lowerlayers. The number of bits employed for the first layer might be setduring a configuration operation. For example, the first row may be madeup of one-bit cells.

As such, taking the example of FIG. 1 to have one-bit cells in its firstlayer, and the number of bits per cell to double as one proceeds from agiven row to the subsequent lower row, the cells of layer L=1 would beone bit cells, the cells of layer L=2 would be two bit cells, and thecells of layer L=3 would be four bit cells. Moreover, taking the cellsof the data structure of FIG. 1 to be mappable to integers, the cells oflayer L=1 could each hold a value ranging from integer 0 to integer 1(binary 0 to binary 1), the cells of layer L=2 could each hold a valueranging from integer 0 to integer 3 (binary 00 to binary 11), and thecells of layer L=3 could each hold a value ranging from integer 0 tointeger 31 (binary 0000 to binary 1111). The top end of such a range—forinstance integer 3 (binary 11) in the case of two bits—might be viewedas a the overflow value for the corresponding cell (e.g., from thevantage point that no further increment is possible).

As another example, there might not be such a stepwise progression inthe number of bits per cell as one progresses layer-wise. For instance,the number of bits employed per cell might be set on a per-row basisduring a confutation operation. For instance, a first layer might be setto have one bit cells, a second layer might be set to have 3 bit cells,and a third layer might be set to have 8 bit cells.

The cells of each of one or more given columns of the data structuremight be interpreted as summing to a value. For instance, with an eyetowards FIG. 1 it is noted that the column m=1 cell of layer L=1, thecolumn m=1 cell of layer L=2, and the column m=1 cell of layer L=3 mightbe interpreted as summing to a value. Likewise might hold with respectto the other data structure columns, column m=2 through column m=8. Assuch, the data structure might be employable in maintaining counts ofitems. For instance, each column of the data structure might be taskedwith keeping count of a particular item. As is discussed in greaterdetail hereinbelow (e.g., in connection with FIGS. 7A-7E and FIG. 8), asan example such an item might be the occurrence of one or more hashfunctions (e.g., SHA1, SHA256, MD5, and/or CRC32) yielding a value of 1with respect to a particular bit position.

As an illustration, suppose that an application of three hash functionscould yield, among eight bit positions, up to three occurrences of avalue of 1 with respect to a particular bit position. Taking an item tobe the yielding of a value of 1 with respect to a particular bitposition, this would mean that the application of the three hashfunctions could yield up to three items. A corresponding data structurecould have eight columns, with each column n being tasked with keepingcount of yieldings of 1 with respect to an nth bit position. As such,where the application of the three hash functions yields a value of 1with respect to the second, fifth, and eighth bit positions, thefollowing would hold. One item would be the yielding of 1 with respectto the second bit position, and the second column of the data structurewould be tasked with keeping track of this item. Another item would bethe yielding of a value of 1 with respect to the fifth bit position, andthe fifth column of the data structure would be tasked with keepingtrack of this item. Yet another item would be the yielding of a 1 withrespect to the eighth bit position, and the eighth column of the datastructure would be tasked with keeping track of this item.

Such employment of multicolumnar data structures in connection with theapplication of hash functions is discussed in greater detail hereinbelowwith respect to FIGS. 7A-7E and FIG. 8.

According to an example, all of the layers of the data structure may bestored in a single memory location (e.g., a single cache). As anotherexample, multiple memory locations (e.g., multiple caches) might beemployed in the storage of the layers. Each such memory location (e.g.,cache) might hold one or more of the layers of the data structure. Withan eye towards FIG. 1 it is noted that, as one illustration the cells oflayer L=1 might be stored in a first cache, the cells of L=2 might bestored in a second cache, and the cells of layer L=3 might be stored ina second cache. As another illustration it is noted, again with an eyetowards FIG. 1, that the cells of layer L=1 might be stored in a firstcache, and both of the cells of layer L=2 and the cells of layer L=3might be stored in a second cache.

Where multiple storage location (e.g., caches) are, as discussed,employed in storing the layers of the data structure, some or all of theemployed caches might differ from one another in properties. Forinstance, the caches might differ in size and/or speed. According to anexample, faster and usually smaller in size memory locations (e.g.,caches) might be employed for upper layers of the data structure and/orslower, but bigger caches might be employed for lower layers of the datastructure. Such an approach might be employed where the application ofthe data structure is such that upper layers are accessed morefrequently than lower layers.

FIG. 2 illustrates a flow diagram of one example of a method ofincrementing the count of an item (e.g., the occurrence of one or morehash functions yielding a value of 1 with respect to a particular bitposition). The operations discussed in connection with FIG. 2 may beperformed with respect to a column, of a data structure of the sortdiscussed herein, tasked with keeping count of that item. According toan example, each cell of such a column may have its value set to zeroprior to the first count incrementation operation. For instance, if theitem being counted were the occurrence of one or more hash functionsyielding a value of 1 with respect to a particular bit position, aheadof performing incrementation to make note of the first occurrence of theone or more hash functions so yielding, the value each cell of therelevant column might be set to zero.

The method may be performed by processing logic that comprises hardware(e.g., circuitry, dedicated logic, programmable logic, microcode, etc.),software (such as instructions run on a processing device), or acombination thereof. As one example, the method may be performed byinstructions running on a computing device. For instance, the method maybe performed by instructions 926 running on computing device 900.

Referring to FIG. 2, at block 201 the processing logic may set a layercounter to correspond to the top layer of the relevant column. Forinstance, where the top layer of the column corresponds to L=1 the layercounter might be set to 1.

At block 203 the processing logic may examine the value held by the cellof the column layer corresponding to the layer counter. At thisjuncture, the flow of FIG. 2 has been such that block 201 was performedand then block 203 was performed. As such, for this performance of block203 the layer counter has been set to correspond to the top layer of thecolumn. This being the case, with this performance of block 203 theprocessing logic examines the value held by the cell located at the toplayer of the column.

At block 205 the processing logic determines whether or not the examinedcell value is an overflow value for that cell (e.g., integer 1(binary 1) in the case of the cell being a one bit cell, or integer 3(binary 11) in the case of the cell being a two bit cell). In the casewhere the value of the cell is not an overflow value the processinglogic increments, at block 207, the value of the cell. In the case wherethe value of the cell is an overflow value the processing logic proceedsto block 209 where the layer counter is incremented (e.g., by 1). Flowthen returns to block 203, which is now performed in connection with theas-incremented layer counter.

FIGS. 3A-3D illustrate one example of the performance (e.g., inaccordance with that which is discussed hereinabove in connection withFIG. 2) of incrementing the count of an item (e.g., the occurrence ofone or more hash functions yielding a value of 1 with respect to aparticular bit position).

At the start of this example, no incrementation has yet been performedwith respect to the item being counted. As such, FIG. 3A shows all cellsof the data structure column, corresponding to the item being counted,having been set to zero. For the example of FIGS. 3A-3D, the top layer(301) of this column 1 holds a one bit cell, the middle layer (303) ofthis column holds a two bit cell, and the lower layer (305) of thiscolumn holds a three bit cell.

From the FIG. 3A start point of this example, a first incrementation isperformed with respect to the item being counted. it is noted, with aneye towards block 201, that the layer counter has a value such that itpoints to the top layer cell of the column. It is noted, with an eyetowards block 203, that the processing logic considers the value of thiscell. As depicted in FIG. 3A, this cell holds a value of zero. As such,with an eye towards block 205 it is noted that the processing logicdetermines whether or not zero is an overflow value for the cell. Asnoted, this top layer cell is a one bit cell. As such, the overflowvalue for this cell is one. The held value of zero is less than theoverflow value of one, and as such it is noted, with an eye towardsblock 205, that the processing logic increments the value of the cell,resulting in that which is depicted in FIG. 3B.

Further according to the example, from here—that is to say the precedingcount increment having completed and the column existing as depicted inFIG. 3B—a subsequent count increment is performed with respect to theitem. With an eye towards block 201 it is noted that the layer counteronce again has a value such that it points to the top layer cell of thecolumn. It is noted, with an eye towards block 203, that the processinglogic considers the value of this cell. As depicted in FIG. 3B, thiscell holds a value of one. It is noted, with an eye towards block 205,that the processing logic determines whether or not one is an overflowvalue for the cell. As noted, the overflow value for this cell is one.Therefore, the held value of the cell is the cell's overflow value. Thisbeing the case, it is noted, with an eye towards block 209, that theprocessing logic increments the layer counter, and then returns to block203.

At block 203 the processing logic considers the value of the cellpointed to by the now-incremented layer counter—the middle layer cell(303) of the column. As depicted in FIG. 3B, this middle layer cellholds a value of zero. At block 205 the processing logic determineswhether or not zero is an overflow value for the cell. Being a two bitcell, the overflow value of for this cell is three. As such, the celldoes not hold an overflow value. This being the case, with an eyetowards block 207 it is noted that the processing logic increments thevalue of the cell, resulting in that which is depicted in FIG. 3C.

Still further according to the example from here—that is to say thesecond count increment having completed and the column existing asdepicted in FIG. 3C—a further count increment is performed with respectto the item. The processing logic proceeds in a way rather similar tothat which was disused in connection with the second count. Theprocessing logic, having appropriately set the layer counter, considersthe top layer cell as depicted in FIG. 3C and finds its held value ofone to be the cell's overflow value (e.g., for the case of two bits, theoverflow value would be integer 3 (binary 11)). This being the case, theprocessing logic increments the layer counter and then considers thevalue held by the middle layer cell. The processing logic finds thiscell's value to be one rather than the overflow value of three for thistwo bit cell. This being the case, the processing logic increments thevalue of the cell resulting in that which is depicted in FIG. 3D.

As discussed, the cells of a given column of a data structure may beinterpreted as summing to a value. In the example of FIGS. 3A-3D, atotal of three count increments were performed. In keeping with this,summing the cells of the FIG. 3D endpoint of the example—that is to sayperforming 1+2+0—yields three.

FIG. 4 illustrates a flow diagram of one example of a methoddecrementing the count of an item (e.g., the occurrence of one or morehash functions yielding a value of 1 with respect to a particular bitposition). The operations discussed in connection with FIG. 2 may beperformed with respect to a column, of a data structure of the sortdiscussed herein, tasked with keeping count of that item. The method maybe performed by processing logic that comprises hardware (e.g.,circuitry, dedicated logic, programmable logic, microcode, etc.),software (such as instructions run on a processing device), or acombination thereof. As one example, the method may be performed byinstructions running on a computing device. For instance, the method maybe performed by instructions 926 running on computing device 900.

Referring to FIG. 4, at block 401 the processing logic may act asdiscussed in connection with block 201 to set a layer counter tocorrespond to the top layer of the relevant column. For instance, wherethe top layer of the column corresponds to L=1 the layer counter mightbe set to 1. At blocks 403 and 405 the processing logic may act asdiscussed in connection with blocks 203 and 205 to examine the value ofthe cell pointed to by the layer counter and to determine whether or notthe examined cell value is an overflow value for that cell.

Unlike that which was discussed in connection with FIG. 2, in the casewhere the value of the cell is not an overflow value the processinglogic decrements, at block 409, the value of the cell. In the case wherethe value of the cell is an overflow value the processing logic proceedsto block 407 where the layer counter is incremented (e.g., by 1). Afterthis increment of the layer counter, flow proceeds to block 411.

At block 411 the processing logic determines whether or not the cellpointed to by the just-incremented layer counter is zero. Where the cellvalue is not zero, flow proceeds to block 409 where the processing logicdecrements the value of the cell.

Where the processing logic instead finds the pointed-to cell to hold avalue of zero, the processing logic proceeds to block 413. At block 413the processing logic decrements the layer counter and then decrementsthe value of the cell pointed to by the as-decremented layer counter.

FIGS. 5A and 5B illustrate one example of the performance (e.g., inaccordance with that which is discussed hereinabove in connection withFIG. 4) of decrementing the count of an item (e.g., the occurrence ofone or more hash functions yielding a value of 1 with respect to aparticular bit position). The example commences as depicted in FIG. 5A,with the data structure column, corresponding to the item being counted,having its top layer (501) holding a value of one, its middle layer(503) holding a value of zero, and its lower layer (505) holding a valueof zero. For the example of FIGS. 5A and 5B, the top layer of the columnholds a one bit cell, the middle layer of the column holds a two bitcell, and the lower layer of this column holds a three bit cell.

With an eye towards block 401 it is noted that the processing logic setsthe layer counter to have a value such that it points to the top layercell of the column. With an eye towards block 403 it is noted that theprocessing logic considers the value of this cell. As depicted in FIG.5A, this cell holds a value of one. With an eye towards block 405 it isnoted that the processing logic determines whether or not one is anoverflow value for the cell. As noted, the top layer of the datastructure has a one bit cell. This being the case, the overflow valuefor this cell is one. Therefore the cell presently holds its overflowvalue. In view of this the processing logic proceeds to block 407 wherethe layer counter is incremented.

It is noted, with an eye towards block 411, that the processing logicdetermines whether or not the cell pointed to by the just-incrementedlayer counter is zero. The just-incremented layer counter points to themiddle layer cell of the column. As depicted in FIG. 5A, this middlelayer cell holds a value of zero. In view of this the processing logicproceeds to block 413. At block 413 the processing logic decrements thelayer counter such that the layer counter points once again to the toplayer cell of the column. Further at block 413 the processing logicdecrements the value of the cell pointed to by the now-decrementedcounter. Thus, the top layer cell is decremented, resulting in thecolumn having cell values as depicted in FIG. 5B.

As discussed, the cells of a given column of a data structure may beinterpreted as summing to a value. In the example of FIGS. 5A and 5B atthe start of the example, depicted in FIG. 5A, the cells of the columnsummed to one (1+0+0=1). Then, at the end of the example, depicted inFIG. 5B, the cells of the column summed to zero (0+0+0=0). As such theend sum of the column is in keeping with that which transpired inconnection with the example of FIGS. 5A and 5B—a decrement of the countof the item from a start value of one, resulting in an end value ofzero.

FIGS. 6A and 6B depict another example of the performance (e.g., inaccordance with that which is discussed hereinabove in connection withFIG. 4) of decrementing the count of an item (e.g., the occurrence ofone or more hash functions yielding a value of 1 with respect to aparticular bit position). The example commences as depicted in FIG. 6A,with the data structure column, corresponding to the item being counted,having its top layer (601) holding a value of one, its middle layer(603) holding a value of two, and its lower layer (605) holding a valueof zero. For the example of FIGS. 6A and 6B, the top layer of the columnholds a one bit cell, the middle layer of the column holds a two bitcell, and the lower layer of this column holds a three bit cell.

It is noted, with an eye towards block 401, that the processing logicsets the layer counter to have a value such that it points to the toplayer cell of the column. It is noted, with an eye towards block 403,that the processing logic considers the value of this cell. As depictedin FIG. 6A, this cell holds a value of one. It is noted, with an eyetowards block 405, that the processing logic determines whether or notone is an overflow value for the cell. As noted, the top layer of thehas a one bit cell. This being the case, the overflow value for thiscell is one. Therefore the cell presently holds its overflow value. Inview of this the processing logic proceeds to block 407 where the layercounter is incremented.

It is noted, with an eye towards block 411, that the processing logicdetermines whether or not the cell pointed to by the just-incrementedlayer counter is zero. The just-incremented layer counter points to themiddle layer cell of the column. As depicted in FIG. 6A, this middlelayer cell holds a value of two. In view of this the processing logicproceeds to block 409 and decrements that value of the cell presentlypointed to by the layer counter—the middle layer cell of the column.This results in the column having cell values as depicted in FIG. 6B.

As discussed, the cells of a given column of a data structure may beinterpreted as summing to a value. In the example of FIGS. 6A and 6B atthe start of the example, depicted in FIG. 6A, the cells of the columnsummed to three (1+2+0=3). Then, at the end of the example, depicted inFIG. 6B, the cells of the column summed to two (1+1+0=2). As such theend sum of the column is in keeping with that which transpired inconnection with the example of FIGS. 6A and 6B—a decrement of the countof the item from a start value of three, resulting in an end value oftwo.

As noted hereinabove, a data structure of the sort discussed herein maybe employable in maintaining counts of items, for instance with eachcolumn of the data structure being tasked with keeping count of aparticular item. Discussed in connection with FIGS. 7A-7E is one exampleof maintaining, with respect to each of multiple items, count of thatitem. In particular, maintained, with respect to each of multiple bitpositions, is count of one or more hash functions yielding a value of 1with respect to that bit position. Discussed in connection with thisexample are both incrementory count (e.g., in accordance with that whichis discussed hereinabove in connection with FIG. 2) and decrementorycount (e.g., in accordance with that which is discussed hereinabove inconnection with FIG. 4).

At the start of this example, no count operations have yet beenperformed with respect to the items being counted. As such FIG. 7A showsall cells of all columns of the data structure having been set to zero.For the example of FIGS. 7A-7E m=8 and therefore the data structure haseight columns of cells. Moreover, L=3 and therefore the data structurehas three layers of cells. Further for this example the cells of the toplayer (701) are one bit cells, the cells of the middle layer (703) aretwo bit cells, and the cells of the bottom layer (705) are three bitcells.

Further for this example, k hash functions are employed with k being setto 3. The application of k hash functions to an input yields theidentification of a value of 1 with respect to j<=k bit positionsamongst the at-hand m bit positions. As such, the application of thesek=3 hash functions to an input yields the identification of a value of 1with respect to j<=3 bit positions amongst m=8 bit positions. As anexample, the incrementory count and/or the decrementory count operationsdiscussed hereinbelow may be performed such that the hashes may becomputed once, and proceeding to lower data structure levels may notinvolve these hashes being computed again. For this example, the mthcolumn of the data structure is tasked with keeping count of instancesof the j<=3 hash functions yielding a 1 with respect to the mth bitposition (e.g., the first column of the data structure is tasked withkeeping count of instances of the hash functions yielding a 1 withrespect to the first bit position, and the sixth column of the datastructure is tasked with keeping count of instances of the hashfunctions yielding a 1 with respect to the sixth bit position).

Firstly in connection with the example, incrementory count is performedwith respect to the application of the three hash functions to an inputα. The application of the three hash functions to α yields a 1 withrespect to the second, fifth, and eighth bit positions. As suchincrementory count in accordance with that which is discussedhereinabove in connection with FIG. 2 is performed with respect to thesecond, fifth, and eighth columns of the data structure as depicted inFIG. 7A. In agreement with that which is discussed in connection withFIG. 2 hereinabove, the result of this incrementory count is as depictedin FIG. 7B.

Also in connection with the example, a further incrementory count isperformed with respect to the three hash functions, with the three hashfunctions now being applied to an input δ. The application of the threehash functions to δ yields a 1 with respect to the third, fifth, andseventh bit positions. As such incrementory count in accordance withthat which is discussed hereinabove in connection with FIG. 2 isperformed with respect to the third, fifth, and seventh columns of thedata structure as depicted in FIG. 7B (i.e., the data structure as itstands subsequent to the performance the discussed incrementory countwith respect to a). In agreement with that which is discussed inconnection with FIG. 2 hereinabove, the result of this incrementorycount for 6 is as depicted in FIG. 7C.

Next in connection with the example yet another incrementory count isperformed with respect to the three hash functions, with the three hashfunctions now being applied to an input β. The application of the threehash functions to β yields a 1 with respect to the first, second, andfifth bit positions. As such incrementory count in accordance with thatwhich is discussed hereinabove in connection with FIG. 2 is performedwith respect to the first, second, and fifth columns of the datastructure as depicted in FIG. 7C (i.e., the data structure as it standssubsequent to the performance the discussed incrementory count withrespect to δ). In agreement with that which is discussed in connectionwith FIG. 2 hereinabove, the result of this incrementory count for ε isas depicted in FIG. 7D.

Now in connection with the example, a decrementory count is performedwith respect to the application of the three hash functions to the notedinput δ. As discussed, the application of the three hash functions to δyields a 1 with respect to the third, fifth, and seventh bit positions.

According to an example, the result of a given application of at-handhashes may be stored (e.g., for a period of time specified in aconfiguration operation). As such, for instance, the result of theapplication of the three hash functions to δ which was performed inconnection with the above-incrementory count with respect to δ mighthave been stored. Under such circumstance, the now-discusseddecrementory count with respect to δ might not involve a reapplicationof the three hash functions to δ, but rather a retrieval of thepreviously stored result. As another example (e.g., where the hashrelevant result had not been stored, and/or where the relevant hashresult had been stored but a specified period for keeping the result hadexpired) the relevant hash might be applied anew.

In light of the application of the three hash functions to δ yielding a1 with respect to the third, fifth, and seventh bit positions,decrementory count in accordance with that which is discussedhereinabove in connection with FIG. 4 is performed with respect to thethird, fifth, and seventh columns of the data structure as depicted inFIG. 7D (i.e., the data structure as it stands subsequent to theperformance the discussed incrementory count with respect to β). Inagreement with that which is discussed in connection with FIG. 4hereinabove, the result of this decrementory count is as depicted inFIG. 7E.

FIG. 8 illustrates a flow diagram of one example of a method of lookup.The method may be performed by processing logic that comprises hardware(e.g., circuitry, dedicated logic, programmable logic, microcode, etc.),software (such as instructions run on a processing device), or acombination thereof. As one example, the method may be performed byinstructions running on a computing device. For instance, the method maybe performed by instructions 926 running on computing device 900. Thelookup will approach the data structure to which it is applied under ascenario wherein it is taken to be the case that the processing logicperforming the lookup operation has no record of count operations beyondthat which can be construed from the considered data structure.

Referring to FIG. 8, at block 801 the processing logic may apply k hashfunctions to the input with respect to which lookup is being performed.At block 803 the processing logic may, for each mth bit position forwhich the hash functions yield a 1, consider the mth column cell of thetop layer of the data structure under consideration.

At block 805, the processing logic may note, with respect to each suchconsidered mth column top layer cell, the presence or absence of a valueof 1. In the case where all such top layer cells possess a value of 1,the processing logic may conclude that there possibly has beenperformance of an incrementory count with respect to the input. In thecase where one or more of such top layer cells possess a value of zero,the processing logic concludes that there has not been performance of anincrementory count with respect to the input.

The noted result of the processing logic determining that there possiblyhas been performance of incrementory count with respect to the inputmight, for instance, be viewed as acting from the vantage point that agiven presence of a 1 in a considered cell might have been arisen due tothe performance of incrementory count with respect to the at-hand input,but might also exist there for another reason. For instance, consideringthe above-discussed hashes performed with respect to a and β, it is seenthat for each of α and β the hashes yield a 1 with respect to the secondbit position. As such, for instance, the presence of a value of 1 in thecorresponding second bit position of the top layer of the might havearisen due to either of α and β, or perhaps for another reason. As such,a lookup considering, say, α might act from the vantage point that itcannot safely conclude, for example, that the value of 1 in the cellarose due to an incrementory count performed with respect to α.

It is noted that the processing logic concluding that there possibly hasbeen performance of the at-hand incrementory count might, perhaps, beviewed indicting that there has been performance of the at-handincrementory count, but with the proviso that such affirmative resultmay be a false positive.

The noted result of the processing logic determining that there has notbeen performance of incrementory count with respect to the input might,for instance, be viewed as acting from the vantage point that thepresence of a zero in a considered cell makes it clear that incrementorycount has not been performed with respect to the input. To wit,incrementory count with respect to the input could not have beenperformed in a way that the considered cell would not have had its valueset to one. For instance, recall that the above-discussed hashesperformed with respect to a yielded a 1 with respect to the second,fifth, and eighth bit positions. As such, even if no other performedincrementory count called for a 1 for these positions, the fact that thehashes upon a did so would have ensured that the second, fifth, andeighth column top row cells of the data would not have retained zeroes.As such, the presence of a zero in the second, fifth, or eighth columntop row cell would indicate that incrementory count had not beenperformed with respect to a.

As noted, lookup involves consideration of the top layer of the of thedata structure. According to an example, other layers of the datastructure are not considered when performing lookup. Such an approachmight, for instance, be adopted from the vantage point that no layersbeyond the top layer of a data structure would need to be considered inorder to yield the above-discussed result that there possibly has beenincrementory count performance, or in order to yield thatabove-discussed result that there has not been incrementory countperformance.

An example of the performance (e.g., in accordance with that which isdiscussed hereinabove in connection with FIG. 8) of lookup will now bediscussed in connection with FIG. 7D. As such, considered will be thedata structure discussed in connection with FIGS. 7A-7E subsequent tothe discussed incrementory count performed with respect to β, but priorto the discussed decrementory count performed with respect to δ.Moreover, as noted lookup approaches the data structure to which it isapplied under a scenario wherein it is taken to be the case that theprocessing logic performing the lookup operation has no record of countoperations beyond that which can be construed from the considered datastructure.

Firstly in connection with the example, lookup will be performed withrespect to α. It is noted, with an eye towards block 801, that asdiscussed above the application of the three hash functions to α yieldsa 1 with respect to the second, fifth, and eighth bit positions. With aneye towards blocks 803 and 805 it is noted that the processing logicconsiders, for each of the second, fifth, and eight column top layercells of the data structure of FIG. 7D, the presence or absence of avalue of 1. As depicted in FIG. 7D, each of these cells contains a valueof 1. As such, the processing logic concludes that there possibly hasbeen performance of an incrementory count with respect to a.

Secondly in connection with the example, lookup will be performed withrespect to an input λ. Suppose, with an eye towards block 801, that theapplication of the three hash functions to λ yields a 1 with respect tothe first, second, and sixth bit positions. With an eye towards blocks803 and 805 it is noted that the processing logic considers, for each ofthe first, second, and sixth column top layer cells of the datastructure of FIG. 7D, the presence or absence of a value of 1. Asdepicted in FIG. 7D the first and second column top layer cells eachcontain a value of 1 but the sixth column top layer cell contains avalue of zero. As such, the processing logic concludes that there hasnot been performance of an incrementory count with respect to λ.

As discussed in connection with the example of FIG. 2 hereinabove,incrementing the count of an item (e.g., the occurrence of one or morehash functions yielding a value of 1 with respect to a particular bitposition) may involve the progression to lower layers of a datastructure.

According to one example, the number of layers possessed by a datastructure may be set prior to performing count operations with respectto that data structure, and with no layers being subsequently added. Asan example, the number of layers and/or the bit size of the cells of thelowest layer might be selected with an with an eye towards avoidingoverflow with respect to the lowest layer. For instance, 64 bit cellsmight be employed for the lowest layer Under such a scenario, in thecase where incrementing the count of an item proceeds down to the bottomlayer of the data structure and then finds an overflow condition withrespect to that layer, the processing logic may not successfullycomplete the at-hand count increment with respect to the item (e.g.,with the processing logic perhaps logging an error to a storage locationand/or displaying an error message to a user via a Graphical UserInterface (GUI) or other interface).

According to a second example, one or more layers possessed by a datastructure may be set prior to performing count operations with respectto that data structure, but then one or more additional layers maysubsequently be added on an as-needed basis. Under such a scenario, inthe case where incrementing the count of an item proceeds down to thebottom layer of the data structure and then finds an overflow conditionwith respect to that layer, the processing logic may, for instance, addone or more layers until at least one layer for which an overflowcondition does not arise is added. The processing logic may then achievethe at-hand count increment with respect to the item by performing cellvalue increment with respect to the first added layer for which there isno overflow.

The approach of this second example might be viewed as having advantageover the approach of the first example by potentially leading to memorysavings. The approach of this first example might be viewed as havingadvantage over the approach of the second example by potentially leadingto time and/or processing savings (e.g., from the vantage point thatadding data structure layers on an as-needed basis might result ineither or both of slower count operations and/or greater processor usein count operations).

According to an example, operations of the sort discussed herein may beemployed so as to implement a filter. Insertion of an entity to thefilter may be performed, for instance, along the lines of theincrementory count discussed in connection with FIGS. 7B-7D. An entityfor which insertion is so performed might be considered to belong to aset (e.g., with the set being given the designation S). Removal of anentity from the filter may be performed, for instance, along the linesof the decrementory count discussed in connection with FIG. 7E. Anentity for which deletion is so performed might be considered to be oneno longer belong to a set. Lookup of an entity with respect to thefilter may be performed, for instance, along the lines of that which isdiscussed in the lookup operations discussed in connection with FIG. 7D.Such lookup of an entity might be considered to be a lookup as towhether or not the entity is in the set.

As one example, such a filter may be employed in connection with afirewall. The firewall might act to insert new flows into the filter.The firewall may act to remove flows from the filter (e.g., flows whichhave expired). The firewall may act to perform flow lookups. As oneexample, the firewall may perform certain intensive (e.g., time,processor, and/or memory intensive) operations with respect to flows andthen store the results of those operations.

The lookup might serve to allow the firewall to realize that a givenflow possibly has been seen before. The firewall, considering that theflow possibly has been seen before, may attempt to retrieve apreviously-stored corresponding result. Bearing in mind the potential afalse positive, the attempt might fail.

The lookup might serve to allow the firewall to realize that a givenflow has not been seen before. In view of this the firewall might opt,for instance, to perform the intensive operations and then save theresult for possible use later.

As another example, such a filter may be alternately or additionallyemployed in connection with a firewall where it is desired to determinewhether or not an incoming flow is a member of a set for which certainfiltering rules apply.

According to an example lookup may only involve the consideration of thetop layer of a data structure and not other layers. Moreover, the toplayer of the data structure may be stored in a fast, small, and/or moreexpensive cache while other layers may be stored in one or more othercaches which may be slower, larger, and/or less expensive than the toplayer cache. As such, lookups, because they only access the top layer,may enjoy the speed of the corresponding fast cache. The use of slower,larger, and/or less expensive for the other layers may be facilitated bythe fact that lookups will not need to access these layers. According toone or more example scenarios, lookups may be performed more frequentlythan other operations involving the data structure. As an example,faster caches may be size-constrained. As such, a small, fast cachemight be employable in view of only the top layer of the datastructure—which might, for instance, possess only one bit cells—needingto be stored there. In contrast, such a fast, small cache might not beemployable had it been called for that a greater portion of the datastructure be stored there.

Moreover, bearing in mind that which is discussed above with respect toincrementory count and decrementory count, the frequency with whichlower data structure layers (e.g., layers beneath the first layer) areaccessed may decrease as the L value increases. This may serve tofacilitate faster, smaller, and/or more expensive caches being used forhigher layers (e.g., with one or more of speed increasing, sizedecreasing, and/or cost increasing as the L value decreases). Moreover,with reference to that which is discussed above the number of bits percell may increase as the value L increases. As such higher, smaller,layers may be able to enjoy smaller, faster caches which might have beenunavailable in the case where greater portions of the data structurewere to have been stored in them.

As noted, the number of bits per cell may increase as one proceeds tolower layers of the data structure (e.g., the number of bits employedfor the cells of a row may double as one proceeds to lower layers). Thisproperty might, from one vantage point, be viewed as a growth in innumber of bits which lends a fractal-like nature to the data structure.

From one vantage point, the above-discussed operations (e.g.,incrementory count and decrementory count) may be viewed as operating ina regular, consistent way with respect to varying values of L, andwithout there being call that the processing logic be aware in advanceof the total number of layers in the data structure or the total size ofthe data structure. Such might be viewed lending a cache-obliviousnessto these operations.

FIG. 9 illustrates a diagrammatic representation of a machine in theexample form of a computing device 900 within which a set ofinstructions, for causing the machine to perform any one or more of themethodologies discussed herein, may be executed. In alternativeexamples, the machine may be connected (e.g., networked) to othermachines in a Local Area Network (LAN), an intranet, an extranet, or theInternet. The machine may operate in the capacity of a server or aclient machine in a client-server network environment, or as a peermachine in a peer-to-peer (or distributed) network environment. Themachine may be a personal computer (PC), a tablet computer, a set-topbox (STB), a Personal Digital Assistant (PDA), a cellular telephone, aweb appliance, a server, a network router, switch or bridge, or anymachine capable of executing a set of instructions (sequential orotherwise) that specify actions to be taken by that machine. Further,while only a single machine is illustrated, the term “machine” shallalso be taken to include any collection of machines (e.g., computers)that individually or jointly execute a set (or multiple sets) ofinstructions to perform any one or more of the methodologies discussedherein.

The example computing device 900 includes a processing device 902, amain memory 904 (e.g., read-only memory (ROM), flash memory, dynamicrandom access memory (DRAM) such as synchronous DRAM (SDRAM) or RambusDRAM (RDRAM), etc.), a static memory 906 (e.g., flash memory, staticrandom access memory (SRAM), etc.), and a secondary memory (e.g., a datastorage device 918), which communicate with each other via a bus 908.

Processing device 902 represents one or more general-purpose processorssuch as a microprocessor, central processing unit, or the like. Moreparticularly, the processing device 902 may be a complex instruction setcomputing (CISC) microprocessor, reduced instruction set computing(RISC) microprocessor, very long instruction word (VLIW) microprocessor,processor implementing other instruction sets, or processorsimplementing a combination of instruction sets. Processing device 902may also be one or more special-purpose processing devices such as anapplication specific integrated circuit (ASIC), a field programmablegate array (FPGA), a digital signal processor (DSP), network processor,or the like. Processing device 902 is configured to execute theprocessing logic (instructions 926) for performing the operations andsteps discussed herein.

The computing device 900 may further include a network interface device922. The computing device 900 also may include a video display unit 910(e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)), analphanumeric input device 912 (e.g., a keyboard), a cursor controldevice 914 (e.g., a mouse), and a signal generation device 920 (e.g., aspeaker).

The data storage device 918 may include a machine-readable storagemedium (or more specifically a computer-readable storage medium) 924 onwhich is stored one or more sets of instructions 926 embodying any oneor more of the methodologies or functions described herein. Theinstructions 926 may also reside, completely or at least partially,within the main memory 904, within the static memory 906 and/or withinthe processing device 902 during execution thereof by the computersystem 900, the main memory 904, static memory 906 and the processingdevice 902 also constituting computer-readable storage media.

While the computer-readable storage medium 924 is shown in an example tobe a single medium, the term “computer-readable storage medium” shouldbe taken to include a single medium or multiple media (e.g., acentralized or distributed database, and/or associated caches andservers) that store the one or more sets of instructions. The term“computer-readable storage medium” shall also be taken to include anymedium other than a carrier wave that is capable of storing or encodinga set of instructions for execution by the machine and that cause themachine to perform any one or more of the methodologies of the presentinvention. The term “computer-readable storage medium” shall accordinglybe taken to include, but not be limited to, solid-state memories, andoptical and magnetic media.

Although the operations of the methods herein are shown and described ina particular order, the order of the operations of each method may bealtered so that certain operations may be performed in an inverse orderor so that certain operation may be performed, at least in part,concurrently with other operations. In another embodiment, instructionsor sub-operations of distinct operations may be in an intermittentand/or alternating manner. It is to be understood that the abovedescription is intended to be illustrative, and not restrictive. Manyother embodiments will be apparent upon reading and understanding theabove description. Although embodiments of the present invention havebeen described with reference to specific example embodiments, it willbe recognized that the invention is not limited to the embodimentsdescribed, but can be practiced with modification and alteration withinthe spirit and scope of the appended claims. Accordingly, thespecification and drawings are to be regarded in an illustrative senserather than a restrictive sense. The scope of the invention should,therefore, be determined with reference to the appended claims, alongwith the full scope of equivalents to which such claims are entitled.Furthermore, the terms “first,” “second,” “third,” “fourth,” etc. asused herein are meant as labels to distinguish among different elementsand may not necessarily have an ordinal meaning according to theirnumerical designation.

What is claimed is:
 1. A method, comprising: setting a layer counter topoint to a first layer of a data structure; determining the layercounter to reference an overflowing cell; incrementing the layer counterto point to a second layer of the data structure; determining theincremented layer counter to reference a non-overflowing cell; andincrementing a value of the non-overflowing cell, wherein the firstlayer is stored in a first cache and the second layer is stored in asecond cache, and wherein the first cache differs from the second cachewith respect to one or more of speed or size.
 2. The method of claim 1,wherein the first layer comprises one or more cells of a first size,wherein the second layer comprises one or more cells of a second size,and wherein the second size is larger than the first size.
 3. The methodof claim 1, wherein the data structure comprises two or more columns,wherein a first of the two or more columns is tasked with keeping countof a first item, and wherein a second of the two or more columns istasked with keeping count of a second item.
 4. The method of claim 1,wherein the increment of the value of the non-overflowing cellcorresponds to a count of one or more hash functions yielding a value ofone with respect to a bit position.
 5. The method of claim 1, furthercomprising: applying one or more hash functions to an input; receiving,via the application, indication with respect to one or more bitpositions; and performing a lookup with respect to the data structure,wherein the lookup accesses a top layer of the data structure, andwherein the lookup access no other layer of the data structure.
 6. Themethod of claim 1, wherein the data structure corresponds to a filter,and wherein the increment of the value of the non-overflowing cellcorresponds to an insertion of an entity into the filter.
 7. The methodof claim 1, further comprising: setting the layer counter to point tothe first layer of the data structure; determining the layer counter toreference a further overflowing cell; subsequently incrementing thelayer counter to point to the second layer of the data structure;determining the subsequently-incremented layer counter to reference azero value cell; decrementing the subsequently-incremented layer counterto point to the first layer of the data structure; and decrementing avalue of a cell pointed to by the decremented layer counter.
 8. Anapparatus, comprising: a memory; and a processing device communicablycoupled to the memory, the processing device to execute instructions to:set a layer counter to point to a first layer of a data structure;determine the layer counter to reference an overflowing cell; incrementthe layer counter to point to a second layer of the data structure;determine the incremented layer counter to reference a non-overflowingcell; and increment a value of the non-overflowing cell, wherein thefirst layer is stored in a first cache and the second layer is stored ina second cache, and wherein the first cache differs from the secondcache with respect to one or more of speed or size.
 9. The apparatus ofclaim 8, wherein the first layer comprises one or more cells of a firstsize, wherein the second layer comprises one or more cells of a secondsize, and wherein the second size is larger than the first size.
 10. Theapparatus of claim 8, wherein the data structure comprises two or morecolumns, wherein a first of the two or more columns is tasked withkeeping count of a first item, and wherein a second of the two or morecolumns is tasked with keeping count of a second item.
 11. The apparatusof claim 8, wherein the increment of the value of the non-overflowingcell corresponds to a count of one or more hash functions yielding avalue of one with respect to a bit position.
 12. The apparatus of claim8, wherein the processing device further executes instructions to: applyone or more hash functions to an input; receive, via the application,indication with respect to one or more bit positions; and perform alookup with respect to the data structure, wherein the lookup accesses atop layer of the data structure, and wherein the lookup access no otherlayer of the data structure.
 13. The apparatus of claim 8, wherein thedata structure corresponds to a filter, and wherein the increment of thevalue of the non-overflowing cell corresponds to an insertion of anentity into the filter.
 14. The apparatus of claim 8, wherein theprocessing device further executes instructions to: set the layercounter to point to the first layer of the data structure; determine thelayer counter to reference a further overflowing cell; subsequentlyincrement the layer counter to point to the second layer of the datastructure; determine the subsequently-incremented layer counter toreference a zero value cell; decrement the subsequently-incrementedlayer counter to point to the first layer of the data structure; anddecrement a value of a cell pointed to by the decremented layer counter.15. A non-transitory machine-readable storage medium storinginstructions which, when executed, cause a processing device to performoperations comprising: setting a layer counter to point to a first layerof a data structure; determining the layer counter to reference anoverflowing cell; incrementing the layer counter to point to a secondlayer of the data structure; determining the incremented layer counterto reference a non-overflowing cell; and incrementing a value of thenon-overflowing cell, wherein the first layer is stored in a first cacheand the second layer is stored in a second cache, and wherein the firstcache differs from the second cache with respect to one or more of speedor size.
 16. The non-transitory machine-readable storage medium of claim15, wherein the first layer comprises one or more cells of a first size,wherein the second layer comprises one or more cells of a second size,and wherein the second size is larger than the first size.
 17. Thenon-transitory machine-readable storage medium of claim 15, wherein thedata structure comprises two or more columns, wherein a first of the twoor more columns is tasked with keeping count of a first item, andwherein a second of the two or more columns is tasked with keeping countof a second item.
 18. The non-transitory machine-readable storage mediumof claim 15, wherein the processing device performs operations furthercomprising: applying one or more hash functions to an input; receiving,via the application, indication with respect to one or more bitpositions; and performing a lookup with respect to the data structure,wherein the lookup accesses a top layer of the data structure, andwherein the lookup access no other layer of the data structure.
 19. Thenon-transitory machine-readable storage medium of claim 15, wherein thedata structure corresponds to a filter, and wherein the increment of thevalue of the non-overflowing cell corresponds to an insertion of anentity into the filter.
 20. The non-transitory machine-readable storagemedium of claim 15, wherein the processing device performs operationsfurther comprising: setting the layer counter to point to the firstlayer of the data structure; determining the layer counter to referencea further overflowing cell; subsequently incrementing the layer counterto point to the second layer of the data structure; determining thesubsequently-incremented layer counter to reference a zero value cell;decrementing the subsequently-incremented layer counter to point to thefirst layer of the data structure; and decrementing a value of a cellpointed to by the decremented layer counter.